package com.mc.cloud.mall.categoryProduct.model.mapper;

import com.mc.cloud.mall.categoryProduct.model.pojo.Product;
import com.mc.cloud.mall.categoryProduct.model.query.ProductListQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);
    
    Product  selectByName(String name);
    
    int batchUpdateSellStatus(@Param("ids") Integer[] ids, @Param("sellStatus") Integer sellStatus);
    
    List<Product> selectListForAdmin();
    
    List<Product> selectList(@Param("query") ProductListQuery query);
}